//
//  LoadData.h
//  食为天
//
//  Created by lanou3g on 14-8-17.
//  Copyright (c) 2014年 三个屌丝. All rights reserved.
//

/*
 这个类主要是用于请求数据,
 传过来一个URl 返回一个data
 
 */
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef void (^LoadDataBlock)(id result);

@interface LoadData : NSObject<NSURLConnectionDataDelegate,UIAlertViewDelegate>
{
    NSString *json;
    BOOL isaddTishi;
    UILabel *alertLabel;
    NSTimer *timer;
}

@property (nonatomic, copy)LoadDataBlock loadData;

@property (nonatomic,retain)NSMutableData *receiveData;

@property (nonatomic,retain) UIView *vi;

+ (instancetype)object;


//Get异步请求
- (void)loadDataAsynchronousWithURL:(NSString *)url Block:(LoadDataBlock) block;
//GET异步请求
- (void)loadDataAsynchronousWithURL:(NSString *)url withDic:(NSDictionary *)dict superView:(UIView *)fahter Block:(LoadDataBlock) block;
//Post异步请求
- (void)loadDataPostAsynchronousWithURL:(NSString *)url withDict:(NSDictionary *)dict superView:(UIView *)fahter isAddtag:(BOOL)isaddtag Block:(LoadDataBlock) block;
//Post异步请求
- (void)loadDataPostAsynchronousWithURL:(NSString *)url withDict:(NSDictionary *)dict Block:(LoadDataBlock) block;

//Get同步请求
- (void)loadDataSynchronousWithURL:(NSString *)url Block:(LoadDataBlock)block;
- (void)loadDataSynchronousWithURL:(NSString *)url dict:(NSDictionary *)dict Block:(LoadDataBlock)block;

@end
